package com.changgou.business.init;

import com.changgou.business.service.AdService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class Init implements InitializingBean {

    @Autowired
    private AdService adService;


    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("运营微服务已经启动！广告缓存预热");

        String positions[]={"web_index_lb"};
        for(String position:positions){
            adService.updateToRedis( position );
        }


    }
}
